/**
 * 
 */
package edu.hm.compiler.parser.grammar;

/**
 * @author Saruman
 */
public class Symbol
{
    private final String consId;

    public Symbol( String consId )
    {
        this.consId = consId;
    }

    public String getConsId()
    {
        return this.consId;
    } // Terminal

    @Override
    public String toString()
    {
        return "Symbol [consId=" + this.consId + "]"; //$NON-NLS-1$ //$NON-NLS-2$
    }

    /*
     * (non-Javadoc)
     * @see java.lang.Object#hashCode()
     */
    @Override
    public int hashCode()
    {
        final int prime = 31;
        int result = 1;
        result = prime * result + ( ( this.consId == null ) ? 0 : this.consId.hashCode() );
        return result;
    }

    /*
     * (non-Javadoc)
     * @see java.lang.Object#equals(java.lang.Object)
     */
    @Override
    public boolean equals( Object obj )
    {
        if( this == obj )
        {
            return true;
        }
        if( obj == null )
        {
            return false;
        }
        if( getClass() != obj.getClass() )
        {
            return false;
        }
        Symbol other = (Symbol) obj;
        if( this.consId == null )
        {
            if( other.consId != null )
            {
                return false;
            }
        } else if( !this.consId.equals( other.consId ) )
        {
            return false;
        }
        return true;
    }

}
